package com.luculent.util.extension.datamasking.ser;

import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.databind.SerializerProvider;
import com.luculent.util.extension.datamasking.annotation.Sensitive;

import java.io.IOException;

/**
 * 字符串序列化
 * @author zhangyang
 * @date 2020/11/2 15:17
 */
public class StringSensitiveSerializer extends BaseSensitiveSerializer<String> {


    protected StringSensitiveSerializer(Sensitive sensitiveInfo) {
        super(sensitiveInfo.type(), sensitiveInfo.keepChars());
    }

    @Override
    public void serialize(String value, JsonGenerator gen, SerializerProvider serializers) throws IOException {
        stringSerialize(value, gen);
    }
}
